import sys
from caffe.proto import caffe_pb2
from caffe.io import blobproto_to_array
import numpy as np

blob = caffe_pb2.BlobProto()
data = open("../../data/dog/dog_mean.binaryproto", "rb").read()
blob.ParseFromString(data)
nparray = np.array(blobproto_to_array(blob))[0]
f = file("dog_mean.npy","wb")
np.save(f,nparray)
f.close()
